home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8055 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  718 b 

  1. Path: news.bellglobal.com!news
  2. From: rchartra@feldspar.com (Ron Chartrand)
  3. Newsgroups: comp.lang.c++
  4. Subject: Random dice program problem need help!!!!!
  5. Date: Wed, 14 Feb 1996 00:08:51 GMT
  6. Organization: Bell Global Solutions
  7. Message-ID: <4fqum6$pbj@news.bellglobal.com>
  8. NNTP-Posting-Host: p001.feldspar.com
  9. X-Newsreader: Forte Free Agent 1.0.82
  10.  
  11. I am using Borland C 4.52 i have been trying to make a callable
  12. routine to simulate rolling 3 six sided dice but it always comes out
  13. to be the same number?? need help!!!!!
  14.  
  15. //3d6 dice roll
  16. void Threed6()
  17. {
  18. randomize();
  19. dice1=0;
  20. dice2=0;
  21. dice3=0;
  22.  
  23. dice1=rand()%6+1;
  24. dice2=rand()%6+1;
  25. dice3=rand()%6+1;
  26. Total=dice1+dice2+dice3;
  27. }
  28.  
  29. just Email me at rchartra@feldspar.com 
  30.  
  31.  
  32.  
  33.